/***
 * @file DoubleExp.h AbsSyn/DoubleExp.h
 *
 *  @Author: calle
 *  @date May 1, 2011
 *  
 *  @brief Terminal double expression
 *  	
 *  Terminal
 *
 *
 */


/**
 * \class DoubleExp DoubleExp.h AbsSyn/DoubleExp.h
 *
 * \brief Double Expression
 * Implements double expression for example 5.1
 *
 * \ingroup AbsSyn
 *  \ingroup Expressions
 *
 */
#ifndef DOUBLEEXP_H_
#define DOUBLEEXP_H_

#include <Interfaces/IExp.h>
#include <AbsSyn/AbsSyn.h>

class IExpVisitor;

class DoubleExp : public IExp {
public:

	/**
	 * \brief type definition of double expression generation function.
	 */
	typedef AbsSyn::IExpPtr (*genDblExpFun)();

	DoubleExp(double d);
	virtual ~DoubleExp();

	/**
	 * \brief set value of double expression
	 *
	 * set method for the value
	 * @param d
	 */
	void setValue(double d);
	/**
	 * \brief get method from the expression
	 *
	 * get double value
	 *
	 * @return value of the terminal expression
	 */
	double getValue() const;

	virtual void accept(IExpVisitor *v);

	/**
	* \brief cloneable expression
	*
	* Abstraction for cloneable.
	* @return Expression interface.
	*/
	virtual IExp* clone() const;

	/**
	 * \brief Implements IPrintable
	 *
	 * @return string representation of Double
	 */
	virtual std::string toString() const;
	/**
	 * \breif Generate Double expression
	 *
	 * Generates a double expression.
	 *
	 */

	static AbsSyn::IExpPtr genreateDblExp();

	bool operator==( const DoubleExp& rhs);
	bool operator!=( const DoubleExp& rhs);
private:
	double m_terminal;
};

#endif /* DOUBLEEXP_H_ */
